package homework;

public class Test01_Animal {
}
class Animal{
    private String name;
    private int age;
    public void makeSound(){
        System.out.println("发出声音");
    }
    public Animal(String name, int age) {
        this.name = name;
        this.age = age;
    }
}
class Dog extends Animal{
    public Dog(String name,int age){
        super(name,age);
    }
    @Override
    public void makeSound() {
        System.out.println("汪汪");;
    }
}
class Cat extends Animal{
    public Cat(String name,int age){
        super(name,age);
    }
    @Override
    public void makeSound() {
        System.out.println("喵喵");;
    }
}
